Skip to content

harden changeset dependency detection#1239

Merged
lukasIO merged 2 commits into
mainfrom
lukas/harden-changeset-detection
Jul 14, 2026
Merged

harden changeset dependency detection#1239
lukasIO merged 2 commits into
mainfrom
lukas/harden-changeset-detection

Conversation

@lukasIO

@lukasIO lukasIO commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Before you submit your PR

Make sure the following is true before submitting your PR:

  • I have read the contributing guidelines and validated that this PR will be accepted.
  • I have read and followed the principles regarding breaking changes, testing, and code quality.

PR description

Describe the changes in this PR. Explain what the PR is meant to solve and how to reproduce the issue in the first place.

Breaking changes

If this PR introduces breaking changes, list them here and document the rationale for introducing such a change.

MSRV

If the PR modifies the crate's MSRV (Minimum Supported Rust Version), document it here.

Testing

Ideally, unit test the code you add, but ensure you're not repeating existing test cases. Use as many already written scaffolding, utilities as possible; write your own, when needed. If external services, APIs, tokens are required (e.g., running an LK server instance), provide the necessary information. Make sure your tests perform useful, context-aware assertions and do not simply emulate "happy paths".

Async

We want the project to be runtime-agnostic, so please reuse what's already in livekit-runtime and feel free to add anything missing. It's ok to use Tokio directly, when writing unit tests, if necessary. When testing, do not use artificial delays for the state to "catch up"; instead, respect the event flow and subscribe properly using channels or other mechanisms.

@lukasIO lukasIO requested a review from ladvoc as a code owner July 10, 2026 07:43
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@xianshijing-lk xianshijing-lk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some questions

def emit(data):
"""Write the result as JSON and exit successfully."""
json.dump(data, sys.stdout)
sys.exit(0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curiously, Is exiting with status 0 even on failures intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, right now the script is treated as being run successfully as the consumer (CI job) gets additional failure metadata via emit.

I can restructure this to exit with a different code on failures if you feel strongly about it?

direct = set()
for f in changed_files:
for pkg_name, pkg_dir in sorted_pkgs:
if f.startswith(pkg_dir + "/"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will the script run on windows?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unlikely, currently the intention for this script is to be run in CI only, but happy to add windows support if you think that's useful

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a case where we would need to run this for Windows in CI.

def emit(data):
"""Write the result as JSON and exit successfully."""
json.dump(data, sys.stdout)
sys.exit(0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the sys.exit() should be called on the upper level rather than emit() function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emit is the last step in the script, basically it's emit_and_exit, I can rename to make the intention clearer?

@lukasIO

lukasIO commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@xianshijing-lk I'll merge this for now, if you have any follow ups on the comments above, I'll address them in a separate PR

@lukasIO lukasIO merged commit a48a678 into main Jul 14, 2026
41 of 45 checks passed
@lukasIO lukasIO deleted the lukas/harden-changeset-detection branch July 14, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants